/**
 * Created by baidm in 2021/11/28 on 12:54
 */
//用于修改运行时的 publicPath
// if (window.__POWERED_BY_QIANKUN__) {
//   __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
// }
import * as config from '../vue.config'

(function () {
  if (window.__POWERED_BY_QIANKUN__) {
    // 解决问题：动态加载路由在主应用中访问子应用会报错 ChunkLoadError: Loading chunk 0 failed
    if (process.env.NODE_ENV === 'development') {
      __webpack_public_path__ = `//localhost:${config.devServer.port}${config.publicPath}`
      return
    }
    __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__
  }
})()
